Master Replication File: Edgerton (2023) JOP

Overview
This master replication file provides a comprehensive execution of various related scripts to replicate the research methods and findings of Edgerton (2023) JOP. Each individual script contains specific steps in the data processing and analysis pipeline. The files can be called in from master_file_replication_v2.r. 

See the master file comments for the version of R and the R packges used. Because this project uses unsupervised learning, the model results are sensitive to the operating system, R version, and R package versions used in the replication. 

In the analysis, I use the following data: 
-BLA dyadic data (bla_dyad.dta)
-DCA data (dca_dyad.csv)
-Diplomatic tie data (dipl_dyad.csv)
-Civil war data (intra_state_wars_cow.dta)
-Polity IV data (p5v2018d.xls)
-PTA data (pta.xls)
-V-Dem data V-(Dem-CY-Core-v12.rds)
-contdir.csv Contiguity data
-QOG government data (qog_std_ts_jan_20.dta)
-states2016.csv from Correlates of War for states in existence. 
-Several data sets from the peacesciencer R package. 

In addition to this import data, I rely on the peacesciencer package which brings in preprocessed data on MIDs, fatal MIDs, CINC, ATOP alliance, major power, and IGO data. For merging purposes, the following adjustments were made: 
-codelist: West Germany, cown == 255 to German Federal Republic, cpwn 260
-codelist: Korea cown == 732 to cown = 730
-PTA: "antigua and barbuda" to "antigua & barbuda"
-PTA: "saint lucia" to "st. lucia"
-PTA: "micronesia" to "federated states of micronesia"
-PTA: "slovak republic" to "slovakia"
-PTA: "united states" to "united states of america"
-PTA: "saint vincent and the grenadines" to "st. vincent and the grenadines"
-PTA: "kyrgyz republic" to "kyrgyzstan"
-PTA: "saint kitts and nevis" to "st. kitts and nevis"
-PTA: "republic of djibouti" to "djibouti"
-PTA: "cote d'ivoire" to "ivory coast"
-PTA: "democratic republic of congo" to "democratic republic of the congo"
-PTA: "cabo verde" to "cape verde"
-Contiguity was imputed to 1 if the distance measure was equal to 0. 
-Contiguity was imputed for South Sudan (ccode 626) to the following states: 625, 530, 500, 501, 484, 490.

File Descriptions
1_create_network_data_replication.r:
Description: Constructs the primary network layer data by processing and structuring relevant datasets.

2_weight_data_replication.r:
Description: Assigns weights to the edges within the network to capture the strength or relevance of connections between nodes.

3_impute_democracy_data_replication.r:
Description: Imputes missing values.

4_create_diffusion_data_replication.r:
Description: Prepares data to analyze the diffusion patterns within the network.

5_analyze_institutional_diffusion_data_replication.r:
Description: Analyzes the diffusion of institutional properties across the network.

6_create_conflict_data_replication.r:
Description: Structures data to study conflicts within the network.

7_analyze_conflict_data_replication.r:
Description: Analysis of the conflict data.

8_create_assortativity_measures_replication.r:
Description: Creates measures of assortativity at the international system level.

9_analyze_systemic_levels_replication.r:
Description: Performs time series analysis on systemic levels.

10_alt_comm_detection_replication.r:
Description: Implements alternative community detection methods.

11_leiden_replication.r:
Description: Replicates the Louvain multiplex analysis with the Leiden algorithm.

12_testing_formula_downweight_replication.r:
Description: Tests various formulas and schemes for downweighting data.

13_testing_formula_downweight_average_replication.r:
Description: Further tests downweighting schemes using average distance.

14_data_visualization_tables_replication.r:
Description: Provides data visualizations and tables to summarize and present the results. 

15_model_fit_bayes_replication.r:
Description: Assesses the fit of the models using Bayesian methods.
